package com.kangyi.user.mapper;

import com.kangyi.user.annotation.AutoFill;
import com.kangyi.entity.GuestsStaying;
import com.kangyi.enumeration.OperationType;
import com.kangyi.vo.GuestsStayingVO;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@Mapper
public interface GuestsStayingMapper {
    List<GuestsStayingVO> queryGuestsStaying(Integer userId);

    @AutoFill(value = OperationType.INSERT)
    void addGuestsStaying(GuestsStaying guestsStaying);

    @Delete("delete from guests_staying where id = #{id}")
    void deleteGuestsStaying(Integer id);

    @Select("select * from guests_staying where id = #{id}")
    GuestsStaying selectById(Integer id);


    GuestsStayingVO inquiryGuestsStaying(Integer id);


    @Select("select name from guests_staying where id = #{guestId};")
    String findNameByGuestId(Integer guestId);


    @Select("select * from guests_staying where user_id = #{userId} and nursing_home_id = #{nursingHomeId}")
    GuestsStaying selectByUserIdAndNursingHomeId(Integer userId, Integer nursingHomeId);
}
